package com.budwk.app.sys.models;

import com.budwk.starter.common.openapi.annotation.ApiModel;
import com.budwk.starter.common.openapi.annotation.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;

import java.io.Serializable;

/**
 * @author wizzer@qq.com
 */
@Data
@Accessors(chain = true)
@Table("sys_mlog_${month}")
@ApiModel(description = "日志对象")
public class Sys_mlog implements Serializable {
    private static final long serialVersionUID = -1400608463498555197L;

    @Column
    @Name
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @ApiModelProperty(description = "主键ID")
    private String id;

    @Column
    @Comment("链路ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @ApiModelProperty(description = "链路ID")
    private String trackId;

    @Column
    @Comment("调用者")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @ApiModelProperty(description = "调用者")
    private String caller;

    @Column
    @Comment("应用ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @ApiModelProperty(description = "应用ID")
    private String appId;

    @Column
    @Comment("微服务标识")
    @ColDefine(type = ColType.VARCHAR, width = 200)
    @ApiModelProperty(description = "微服务标识")
    private String microId;

    @Column
    @Comment("上一标识")
    @ColDefine(type = ColType.VARCHAR, width = 200)
    @ApiModelProperty(description = "上一标识")
    private String lastId;

    @Column
    @Comment("当前标识")
    @ColDefine(type = ColType.VARCHAR, width = 200)
    @ApiModelProperty(description = "当前标识")
    private String currId;

    @Column
    @Comment("日志类型")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @ApiModelProperty(description = "日志类型")
    private String type;

    @Column
    @Comment("日志标签")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @ApiModelProperty(description = "日志内容")
    private String tag;

    @Column
    @Comment("日志内容")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @ApiModelProperty(description = "日志内容")
    private String msg;

    @Column
    @Comment("执行方法")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @ApiModelProperty(description = "执行方法")
    private String method;

    @Column
    @Comment("请求路径")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @ApiModelProperty(description = "请求路径")
    private String url;

    @Column
    @Comment("IP地址")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @ApiModelProperty(description = "IP地址")
    private String ip;

    @Column
    @Comment("请求参数")
    @ColDefine(type = ColType.TEXT)
    @ApiModelProperty(description = "请求参数")
    private String params;

    @Column
    @Comment("执行结果")
    @ColDefine(type = ColType.TEXT)
    @ApiModelProperty(description = "执行结果")
    private String result;

    @Column
    @Comment("异常信息")
    @ColDefine(type = ColType.TEXT)
    @ApiModelProperty(description = "异常信息")
    private String exception;

    @Column
    @Comment("执行耗时")
    @ApiModelProperty(description = "执行耗时")
    private Long executeTime;

    @Column
    @Comment("创建时间")
    @ApiModelProperty(description = "创建时间")
    private Long createdAt;
}
